<template>
  <div class="app-topmenu">
    <!-- 系统标题 -->
    <div class="title">
      <img src="@/assets/images/icon/layout/编辑.png" class="titlePic" />
      <span class="titleText">南沙区标准地址查询系统</span>
    </div>
    <!-- 系统用户 -->
    <div class="user">
      <img src="@/assets/images/icon/layout/用户.png" />
      <span>{{ systemUser }}</span>
    </div>
  </div>
</template>

<script>
/* eslint-disable */
import { getCurrentInstance, onMounted } from "vue";
import { useRoute } from "vue-router";
import pubsub from "pubsub-js";

export default {
  name: "AppTopmenu",
  data() {
    return {
      systemUser: "用户名",
    };
  },
  setup() {
    const { proxy } = getCurrentInstance();
    const route = useRoute();

    onMounted(() => {
      // 获取查询参数 userName
      const userName = route.query.userName;
      console.log(`用户名：${userName}`);
    });

    return {};
  },
};
</script>

<style lang="less" scoped>
.app-topmenu {
  position: absolute;
  width: 100%;
  padding-left: 0.5%;
  top: 0%;
  height: 5%;
  z-index: 999;
  display: flex;
  justify-content: left;
  align-items: center;
  background-color: #3f69e4;
}
.titlePic {
  width: 40px;
  margin-top: -15px;
}
.titleText {
  font-family: "方正小标宋简体";
  color: white;
  position: relative;
  left: 1.5%;
  // top: 8px;
  font-size: 270%;
}

.user {
  position: absolute;
  right: 0.5%;
  color: white;
  font-size: 120%;
  display: flex;
  align-items: center;
  border-radius: 5px;
  padding: 8px;
  > img {
    width: 25px;
    margin: 0 5px;
  }
}
.mapName {
  font-size: 230%;
  font-weight: bold;
  text-align: center;
  margin: 0 auto;
}
</style>